import argparse

def ArgsParser():
    parser = argparse.ArgumentParser(description="DPFL experiment")
    # base config arguments
    parser.add_argument('--base-config', type=str, default='base_config.json')

    # training arguments
    parser.add_argument('-e','--epochs', type=int, default=25, help="epochs of training or local training")
    parser.add_argument('-bs','--batch_size', type=int, default=32, help="train&test batch size")
    parser.add_argument('-opt','--optimizer', type=str, default='adam', help="optimizer type")
    parser.add_argument('--lr', type=float, default=4e-4, help="learning rate")
    parser.add_argument('-mom','--momentum', type=float, default=0.0, help='optimizer momentum')
    parser.add_argument('-dc','--decay', type=float, default=0, help="learning rate decay each round")
    parser.add_argument('-m','--model', type=str, default='resnet18', help='name of the training model')
    parser.add_argument('-dst','--data_set', type=str, default='facescrub', help="name of dataset")
    parser.add_argument('-ptrain','--pretrained', action='store_true', help="use pretrained resnet model")
    parser.add_argument('-frz','--freeze_ftrs', action='store_true', help="freeze the resent all layers except the final fc layers during the training process")

    #experiment settings
    parser.add_argument('--exp-config', 
                        type=str, 
                        default=None
                        )

    parser.add_argument('-er','--experiment_rounds',
                        type=int,
                        default=1,
                        help="execute experiment for er times"
                        )

    parser.add_argument('-sm','--save_model',
                        action='store_true',
                        help="save trained global models. default:false"
                        )
    
    parser.add_argument('-sr','--save_result',
                        action='store_false',
                        help='save experiment results. default:true'
                        )
    
    parser.add_argument('-tab','--export_tabel',
                        action='store_true',
                        help='save experiment tabel img. default:false'
                        )
    
    parser.add_argument('-si','--show_info',
                        action='store_false',
                        help='print info to the console during training process. default:true'
                        )

    args = parser.parse_args()
    return args